package com.xyz.domain.ext;

import org.apache.commons.lang3.StringUtils;

public enum EnumFundFlowForm {

    REWARD_REGISTER("001","注册奖励"),
    ACT_LOTTERY("101","抽奖积分"),
    ACT_GAME("102","福利游戏"),
    ACT_RECOMMEND("103","推荐新人"),
    ACT_SENDCARD("104","赠送密卡"),
    ACT_OPENCARD("105","密卡获得"),
    REWARD_SIGN("106","签到奖励"),
    REWARD_MONTHSIGN("107","月度签到奖励"),
    ACT_SECRECOMMEND("108","二级推荐新人"),
    VIP_GAME("201","vip首开奖励"),
    VIP_RELIEVE("202","vip救济"),
    VIP_SALARY("203","vip工资"),
    VIP_CONTINUEOPEN("204","vip续开奖励"),
    GAME_TRIAL("301","游戏试玩");

    private String name;

    private String key;

    EnumFundFlowForm(String key, String name){
        this.name = name;
        this.key = key;
    }

    public EnumCardType getByKey(String key){
        if(StringUtils.isEmpty(key)){
            return null;
        }
        for(EnumCardType source : EnumCardType.values()){
            if(source.getKey().equals(key)){
                return source;
            }
        }
        return  null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

}
